
    Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
    var form = document.getElementById('RenderTable');
    
    
    
    
    function BeginRequestHandler(sender, args)
    {
        FloatTopDiv();
         var elem = args.get_postBackElement();
         ActivateAlertDiv('visible', 'AlertDiv', '<B>Loading...</b>');
         //var bgFilter = document.getElementById("bgFilter");
         //bgFilter.className = "bgFilter";
         //bgFilter.style.height = document.body.clientHeight + document.body.scrollTop;
         document.getElementById("bgFilter").style.height = document.getElementById('maintable').offsetHeight + 'px';
         document.getElementById("bgFilter").style.display = 'block';
         isDisableForm = true;
    }
    function EndRequestHandler(sender, args)
    {
         ActivateAlertDiv('hidden', 'AlertDiv', '');
         form.disabled = false;   
         isDisableForm = false; 
          document.getElementById("bgFilter").style.display = 'none';
         //var bgFilter = document.getElementById("bgFilter");
         //bgFilter.className = "";  
         //bgFilter.style.height = "";   
         //Test();
         //alert("End Request");
    }
    
    function ActivateAlertDiv(visstring, elem, msg)
    {
         var adiv = $get(elem);
         adiv.style.visibility = visstring;
         adiv.innerHTML = msg;
    }

function FloatTopDiv()
	{return;
		startX = document.body.clientWidth - 80, startY = 0;
		var ns = (navigator.appName.indexOf("Netscape") != -1);
		var d = document;
		
		
		function ml(id)
		{
			var el=d.getElementById;
			if(d.layers)el.style=el;
			el.sP=function(x,y){this.style.left=x;this.style.top=y;};
			el.x = startX;
			el.y = startY;
			return el;
		}
		
		window.stayTopLeft=function()
		{
			if (document.documentElement && document.documentElement.scrollTop)
				var pY = ns ? pageYOffset : document.documentElement.scrollTop;
			else if (document.body)
				var pY = ns ? pageYOffset : document.body.scrollTop;

			if (document.body.scrollTop > 71){startY = 0} else {startY = 0};

			if (document.body.clientWidth >= 1024)
			{
				ftlObj.x = document.body.clientWidth - 80;ftlObj.y =pY;ftlObj.sP(ftlObj.x, ftlObj.y);
			}
			else
			{
			    ftlObj.x  = startX;
			    ftlObj.y += (pY + startY - ftlObj.y)/32;
			    ftlObj.sP(ftlObj.x, ftlObj.y);
			}
			
			setTimeout("stayTopLeft()", 1);
		}
		
		ftlObj = ml("AlertDiv");
		stayTopLeft();
		
	}


	//FloatTopDiv();
